Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

aveeeeeee7en
Not applicable

Logic in Pivot Table

Hi Community

See the Attachment

Regards

Aviral Nag

Tags (1)
12 Replies
Not applicable

Re: Logic in Pivot Table

Maybe you can use this:

Count(DISTINCT if(aggr(nodistinct max(CompletedDate),MaxState)=CompletedDate,TicketID))

Attached.

aveeeeeee7en
Not applicable

Re: Logic in Pivot Table

Thanks Ajay for your reply but your logic is not working.

If you select Feb 2014 from field Monthname and Select India from field State it will show you 6 Tickets whereas from your formula i am getting 1 Ticket.

Not applicable

Re: Logic in Pivot Table

For the selections you mentioned the max date in Completed Date is 27/02/2014 for which there is just one 

TicketID - 110.

Should a different logic be used to calculate that.

aveeeeeee7en
Not applicable

Re: Logic in Pivot Table

If You Go to Edit Script, than you'll see that i have picked the 2nd Max Completed Data "Key" wise.

So, the Max Date will come different for each case.

aveeeeeee7en
Not applicable

Re: Logic in Pivot Table


  • Any Suggestions.
PrashantSangle
Not applicable

Re: Logic in Pivot Table

Hi,

Use this as your expression

Aggr(Count(DISTINCT TicketID),TicketID)

Checked enclose file,

Great dreamer's dreams never fulfilled, they are always transcended.
aveeeeeee7en
Not applicable

Re: Logic in Pivot Table

Thanks for your reply.

This is not what I want..  Kindly read the post and see the Attachment.

tresesco
Not applicable

Re: Logic in Pivot Table

Try :

Count({<State=p(MaxState)>}DISTINCT TicketID)

aveeeeeee7en
Not applicable

Re: Re: Logic in Pivot Table

Thanks Tresesco for your reply.

There were some minute discrepancies. Not able to understand how to tackle it.

See the Attchment.