Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
tomovangel
Partner - Specialist
Partner - Specialist

Invoice Buckets

Hello guys, I am trying to create invoice buckets for one of my clients

first I define my variable like this :
let vDate = Date(Today());

table:

LOAD

    Customer,

    InvoiceNo,

    InvoiceDate,

    BookEntryDate,

    TransactionNo,

    Currency,

    "Amount LocCur",

    if('$(vDate)' - Date(InvoiceDate)>='7','7 days',

    if('$(vDate)' - Date(InvoiceDate)>='30','30 days',

    if('$(vDate)' - Date(InvoiceDate)>='90','90 days',

    if('$(vDate)' - Date(InvoiceDate)>='180','180 days',

    if('$(vDate)' - Date(InvoiceDate)>='360','360 days','Not Yet'))))) as Timebuckets

from ....

But in the Pivot Chart I made with Customers, I see only Not Yet...


What am I doing wrong?

20 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Finally, to make sure the buckets sort correctly:

    if($(vDate) - InvoiceDate >= '360', dual('360 days', 360),

    if($(vDate) - InvoiceDate >= '180', dual('180 days', 180),

    if($(vDate) - InvoiceDate >= '90', dual('90 days', 90),

    if($(vDate) - InvoiceDate >= '30', dual('30 days', 30),

    if($(vDate) - InvoiceDate >= '7', dual('7 days', 7), dual('Not Yet', 999))))))

Now you can sort them numerically. If you want 'Not Yet' to be he first then use 0 instead of 999.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein