Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
danilodct
New Contributor III

Comparing two fields on Set Analisys

Thats my data cloud:

TABLE: ATTENDANCE_REGISTER

COLUNS: "REG_NUMBER", "YEAR_MONTH_REGISTERED", "YEAR_MONTH_CLOSED", "%KEY_YEAR_MONTH_NUMBER"

TABLE: CLIENT

COLUNS: "CLI_NUMBER", "YEAR", "MONTH", "%KEY_YEAR_MONTH_NUMBER"

I wanna make a pivot table with these dimensions: "YEAR", "MONTH" and this expression: the quantity of ATTENDENCE_REGISTER that was registered and closed at the same year_month.


The Set Analisys i'm using is:


COUNT({<YEAR_MONTH_REGISTERED={'$(=YEAR_MONTH_CLOSED)'}>} REG_NUMBER)

But it doesnt work! Any one help me?


Thanks!

2 Replies
mwoolf
Honored Contributor II

Re: Comparing two fields on Set Analisys

Try:

COUNT({<YEAR_MONTH_REGISTERED={YEAR_MONTH_CLOSED}>} REG_NUMBER)

Re: Comparing two fields on Set Analisys

Sorry to say, syntax is wrong. Should be this


If(YEAR_MONTH_REGISTERED=YEAR_MONTH_CLOSED, 1,0) as flag


And expression is

Count({<flag = {1}>} REG_NUMBER)


Or

COUNT({<YEAR_MONTH_REGISTERED={"=YEAR_MONTH_REGISTERED

=YEAR_MONTH_CLOSED>} REG_NUMBER)

Or finally


Count(if(YEAR_MONTH_REGISTER= YEAR_MONTH_CLOSED, REG_NUMBER))

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)