Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ashishpalkar
Creator III
Creator III

How to use {} in script.

Hi There

I am using below set analysis in Chart Table, i want to use this at script level.

any suggestions?

IF(Country='US','N/A',sum({$<MNTH={'0'}>} [Revenue]))

thanks in advance,

10 Replies
swuehl
MVP
MVP

Your set analysis will only filter MNTH field with a fixed value, but the aggregation will still regard other user selections.

How will you handle this in the script?

maxgro
MVP
MVP

Do you want a sum of Revenue by Country (excluding US) ?

ashishpalkar
Creator III
Creator III
Author

Yes , and month can be from 0 to 12.

MarcoWedel

please post sample data and expected result.

thanks

regards

Marco

MayilVahanan

Hi

Hope country, revenue and month field are available in same table.

If so, try like this

Load *,

IF(Country <> 'US' and MNTH = 0,[Revenue], 0) AS MonthZeroNonUSRevenue,

IF(Country <> 'US' and MNTH = 0,1, 0) AS MonthZeroNonUSFlag;

Exp:

=Sum({<MonthZeroNonUSFlag ={1}>}Revenue)

or

=Sum(MonthZeroNonUSRevenue)

Else, please post sample data and required output.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Anonymous
Not applicable

If Country, Month, Revenue field are in same table, then this should work:

at script table:


IF(Country='US','N/A',if(Month='0', sum(Revenue)))


Not applicable

Try This :

IF(Country='US','N/A',if(Month='0',Revenue)) as Revenue1


then summation you can do on the dashboard as sum(Revenue1)


Thanks

Khushboo

ahmar811
Creator III
Creator III

hi Ashish

try this


IF(wildmatch(Country,'US')=0,'N/A',if(Month='0', sum(Revenue)))


hope this help you



Regards

Ahmar

tripatirao
Creator II
Creator II

Hi

As per my knowledge we can't use set expression in qlikview scripting.

Try something like  using groupby clause.

or you can follow what khushboo suggested.

Regards

Tripati