Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Problem Script Half Year

Hi All,

Can you help me,

i have a template report with  ID & Dimension, and i want to sum amount half year '201307','201308','201309','201310','201311','201312'

please see my script :

 

if (ID = 'L19-1', sum({$<PERIOD_REPORT={'201307','201308','201309','201310','201311','201312'}>} [AMNT]))

I've tried this script, but this script is not correct.

Please help me...

Thanks & Regards.

4 Replies
Not applicable

Re: Problem Script Half Year

try this.

sum ( {< ID={'L19-1'}, PERIOD_REPORT={'201307',.......}>} AMNT)

sergey_maka8
Valued Contributor

Re: Problem Script Half Year

If you tried it in load script - it doesn't work, because you can't use set analysis in the load script.

But  for expression it looks good.

Share your app please it you'd like to get extended answer

Not applicable

Re: Problem Script Half Year

Hi Ram,

I can't use Sum for the first script, please see my next script expression:

if (ID = 'L19-1', sum(Periode,('201307','201308','201309','201310','201311','201312') [amount],
if(ID = 'L19-2', sum(),
if(ID = 'L19-3', sum(),
if(ID = 'L19-4', sum(),
if(ID = 'L19-5', sum(),
if(ID = 'L19-6', sum(),
if(ID = 'L19-7', sum(),
if(ID = 'L19-8', sum(),
if(ID = 'L19-9', sum(),
if(ID = 'L19-10', sum(),
if(ID = 'L19-11', '',
)))))))))))

"L19-1" or "L19-2" and others<-- this is the field name

and the problem is how to write sum with Periode '201307','201308','201309','201310','201311','201312'

Not applicable

Re: Problem Script Half Year

load

sum (if (ID-'L19-1' and Match(PeriodCode,'201307','201308','201309','201310','201311','201312'), amount,

   if (Match(ID,'L19-2','L19-3','L19-4','L19-5','L19-6','L19-7','L19-8','L19-9',L19-10'),amount,
0

) as amount)

resident

tab1;

Community Browser