Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Straight table expression not working?


HI,

I have to write a expression based on below condition

IF Status='Open' then NUM(DataColumn1-DataColumn2)

I am trying to use if(Status=Open', NUM(DataColumn1-DataColumn2)). But straight table column is showing blank. table is not loading any data. Is there any error in expression? please can anyone suggest me

Thanks.

24 Replies
Not applicable
Author

Where am I missing single quote? please let me know

Anonymous
Not applicable
Author

What about this?

if(Status='Open', NUM(DataColumn1-DataColumn2))


or


if(Status='Open', (DataColumn1-DataColumn2)).

Mark_Little
Luminary
Luminary

Hi,

I would guess you are getting a number of results returned for each of the field in your expression, Try something like

if(Status='Open', NUM(MAX(DataColumn1)-MAX(DataColumn2)))

to test.

I think Need to make sure that DataColumn1 and DataColumn2 are just returning one distinct value.

Mark

Not applicable
Author

Thanks. Tried not working.

Mark_Little
Luminary
Luminary

Hi Amelia,

Can you supply some demo data?

Logically everything suggested would work in a standard example.

There could be a number of reasons you seeing blank values return, like String values, multiple values being evaluated when one is expected.

Mark

Not applicable
Author

here is sample data

                                 

Week(EnterDate)Data1
152
263
3107
454
579
680
7108
880
978
10106
1180

Data1 is calculated by using expression NUM(DataColumn1-DataColumn2) and Dimensions are Dim1: Week(EnterDate)   and Dim2: =IF(MATCH(Status,'Open'),Status), Dim3: CustomerID

                                         

Week(EnterDate)Data2
118.2
217.0
348.0
430.5
520.9
629.3
742.4
830.7
914.5
1017.2
1134.9

Data2 is calculated by using expression NUM(DataColumn3-DataColumn4) and Dimensions are Dim1: Week(EnterDate)   and Dim2: =IF(MATCH(Status,'Closed'),Status), Dim3: CustomerID

                                         

Week(EnterDate)Data3
1102
299
3102
4100
5106
691
782
884
975
1093
1198

Data3 is calculated by using expression NUM(DataColumn5-DataColumn6) and Dimensions are Dim1: Week(EnterDate)   and Dim2: =IF(MATCH(Status,'Required'),Status), Dim3: CustomerID

above all three tables are working fine. but when I am merging data into one straight table blank values are coming. I need a table as below with Dimension: Week(EnterDate) and expressions should be with Data1, Data2, Data3

                                                                     

Week(EnterDate)Data1Data2Data3
15218.2102
26317.099
310748.0102
45430.5100
57920.9106
68029.391
710842.482
88030.784
97814.575
1010617.293
118034.998

Please help me to sort out this. sorry if I am not clear in my post when I asked at the beginning

sunny_talwar

Try this may be:

Dimension:

1) Week(EnterDate)

2) CustomerID

Expressions:

Data1: Num(Only({<Status = {'Open'}>}DataColumn1)-Only({<Status = {'Open'}>}DataColumn2))

Data2: Num(Only({<Status = {'Closed'}>}DataColumn1)-Only({<Status = {'Closed'}>}DataColumn2))

Data3: Num(Only({<Status = {'Required'}>}DataColumn1)-Only({<Status = {'Required'}>}DataColumn2))

MarcoWedel

maybe just a typo in your example:

if(Status='Open', NUM(DataColumn1-DataColumn2))


regards


Marco

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Are DataColumn1, DataColumn2, fields in your data? Or labels in your chart?

-Rob

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this using Sum() instead of Only()

Sum({<Status = {'Open'}>}DataColumn1)-Sum({<Status = {'Open'}>}DataColumn2)


Regards,

Jagan.