Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

IF THEN Capabilities
(1 viewing) (1) Guest
Go to bottomPage: 12
TOPIC: IF THEN Capabilities
#19387
IF THEN Capabilities 12 Years, 6 Months ago Karma: 0
I am using the table to display the output voltages for like 9,000 power supplies. These power supplies could have up to 4 voltages. Here is the syntax I was planning to use:

{$columns:V1} V<br>{$columns:V2} V<br>{$columns:V3} V<br>{$columns:V4} V

The issue is that most of the supplies only have one output, which would make my table look odd, is there a way to include an IF value = 0 skip the value and my extra "V" at the end?

Please advise.
The administrator has disabled public write access.
 
#19397
Re:IF THEN Capabilities 12 Years, 6 Months ago Karma: 746
Hello,

Do you load data from a database?

Regards,
ARI Soft
The administrator has disabled public write access.
 
#19427
Re:IF THEN Capabilities 12 Years, 6 Months ago Karma: 0
I load from the local database
The administrator has disabled public write access.
 
#19540
Re:IF THEN Capabilities 12 Years, 6 Months ago Karma: 746
You can use SQL query in the next way:

Code:


SELECT 
 CONCAT(
   IF(LENGTH(IFNULL(V1, '')) > 0, CONCAT(V1, '<br/>'), ''),
   IF(LENGTH(IFNULL(V2, '')) > 0, CONCAT(V2, '<br/>'), ''),
   IF(LENGTH(IFNULL(V3, '')) > 0, CONCAT(V3, '<br/>'), ''),
   IF(LENGTH(IFNULL(V4, '')) > 0, CONCAT(V4, '<br/>'), '')
 ) AS V
FROM
  tbl



Regards,
ARI Soft
The administrator has disabled public write access.
 
#19969
Re:IF THEN Capabilities 12 Years, 6 Months ago Karma: 0
I tried to implement your example into what I am doing, but was unsuccessful. Below is the syntax I am starting with:

SELECT
OUI.factory, OI.part, OUI.factory2, OUI.series, OUI.power, OUI.convection, OUI.type, OI.V1, OI.A1, OI.V2, OI.A2, OI.V3, OI.A3, OI.V4, OI.A4, OI.Efficiency, OUI.dimensions

FROM
jos_part OI INNER JOIN jos_series OUI ON OI.series = OUI.series
WHERE OI.V2 > 0 AND OUI.type = 'Open Frame' AND OUI.safety = ''


I need the V1 and A1 values to not display if their value is NULL, and if they are present to display a V or A after their value (V for V# and A for A#).

Thanks for the help,

Gorden.
The administrator has disabled public write access.
 
#19978
Re:IF THEN Capabilities 12 Years, 6 Months ago Karma: 746
In your original post, you want to show V1, V2, ..., VN in one column on frontend and the solution from our previous post can be used for this. Do you want to show V1, A1, ...,Vn, An values in separate columns? If yes, it is not possible to hide Vn column if it has NULL in all records selected from database.

Regards,
ARI Soft
The administrator has disabled public write access.
 
Go to topPage: 12