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: 
berryandcherry6
Creator III
Creator III

Ranking data with condition in script

Hi,

I have two tables, with datas as below

table 1:

campaignIDstartdateexpiration date
103-13-201703-26-2017
203-05-201703-17-2017
303-02-201703-14-2017
402-28-2017

03-13-2017

Table 2:    

campaignIDvalue_typeadvertisementSales
143523
24672
34453
141256
253334
34542
35556
4432
4545

Now i need to add rank column and sum type column to table,through script by creating single table  like below, where i need to check for  condition

1.) Active campaign, where expiration date >= today, will be given top ranking

2.) latest Expired Campaign, where expiration date < today(), will be given least ranking.

   

campaignIDvalue_typesum typeSumrank
14advertisement47top 1
24advertisement100top 2
34advertisement45top 3
14Sales79top 1
24Sales36top 2
34Sales3top 3

Any idea, suggestion, workaround are all appreciated. Please help me to find solution for this. let me know if any clarification is required

1 Reply
arockiyaselvana
Partner - Creator
Partner - Creator

Hi,

1. To create the "sum type" column, you can use cross table concept.

2. For Ranking concept, you can create the rank in Front End using Rank() function.