Getting error while importing customers in Magento community - magento

I am getting this error while importing customers in the community version of Magento. There is no such column like 'reward_update_notification' and 'reward_warning_notification'.
Required attribute 'reward_update_notification' has an empty value in rows: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Required attribute 'reward_warning_notification' has an empty value in rows: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Magento version is 1.9.0.1
Thanks

I do not know what is causing the problem. When you export new customers the column is there but the fields are empty.
Add the columns (with field names on line 1) and fill them with "1"
it works.
Erik

Related

There is error while uploading csv file in play console. How to avoid it?

invalid row(s) in the CSV file: 1, 2, 3, 4, 5, 6, 7, 8, 9 ..etc
Your format is incorrect should make like this:
As in picture you only can add email address in one column with multiple rows

Query using whereIn() not working to generate collection

I have this table store_photos and I am trying to get the photos with complete raffle_date_id upto 12 and then group them by user_id. The query works but then it still generate collection even if its not complete upto 12. How can I achieve this using whereIn() or other similar eloquent?
public function collection(): Collection
{
$months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
return StorePhoto::with('user.location')
->whereIn('raffle_date_id', $months)
->groupBy('user_id')
->get();
}
You can try constructing the RAW SQL query, to find what you are trying to achieve.
Then you can slowly build your way in Laravel.
You can try to find those users who have count of 12 (i.e. have 12 records = have 12 months). Then you can get only those users.
SELECT user_id FROM store_photos AS sp
GROUP BY sp.user_id
HAVING COUNT(sp.user_id) = 12;
Then in Laravel you can
DB::table('store_photos')
->groupBy('user_id')
->having(DB::raw('count(user_id)'), '=', 12)
->select('user_id');
*I do not know that much about your app and its business logic / requirement. But you get the idea :)

SSRS date expression tweak

In SSRS I am currently using this expression:
=IIF(Today() >= DateSerial(Year(Today()), 4, 1),DateSerial(Year(Today()), 4, 1), DateSerial(Year(Today()) - 1, 4, 1))
In a date parameter (default values, specify values). This gives me 01/04/2018.
However for one particular report it would be helpful for the date to default to the previous year - e.g. 01/04/2017.
I've tried to tweak the above expression to make this work, but haven't succeeded. Can this expression be changed to go back one year?
Thanks.
=IIF(Today() >= DateSerial(Year(Today()), 4, 1),DateSerial(Year(Today())-1, 4, 1), DateSerial(Year(Today())- 2, 4, 1))

Qlikview aggration with conditions

I have some data like below -
id, fn, ln, logdate
1, Rob, Hep, 01-04-2010
2, Rob, Hep, 09-04-2010
3, Rob, Hep, 10-10-2012
4, Rob, Hep, 01-12-2009
5, Peter, Cheng, 02-10-2010
6, bob, Pen, 05-10-2009
7, Peter, Cheng, 01-10-2009
8, Kim, Rany, 08-01-2010
I will have to write an expression
Group the above data by fn+ln.
From the Group get the record of min(logdate)
For each min logdate from above, find count if the date is above '01-01-2010'
So in this example -
I should get count as one. (Rob Hep's min log date is 01-12-2009 and Peter Cheng's 01-10-2009 and bob Pen's is alos 05-10-2009 all of them are before 01-01-2009)
Can some one help me in writing the expression for it please?
First the load script:
Table:
Load id,
fn,
ln,
logdate,
fn & ' ' & ln as name,
num(Date#(logdate, 'DD-MM-YYYY')) as numdate inline [
id, fn, ln, logdate
1, Rob, Hep, 01-04-2010
2, Rob, Hep, 09-04-2010
3, Rob, Hep, 10-10-2012
4, Rob, Hep, 01-12-2009
5, Peter, Cheng, 02-10-2010
6, bob, Pen, 05-10-2009
7, Peter, Cheng, 01-10-2009
8, Kim, Rany, 08-01-2010
];
I added one field for the name and an other one for the numeric value of the date. That makes it easier (even possible?) in the set expression.
Then I added a variable
vNumdate =num(date#('01-01-2010','DD-MM-YYYY'))
so you can edit it in the dashboard.
In the dashboard I have all the fields, a textfield containig the vNumdate and a
diagram (type table).
The dimension of the diagram is the field name
And the formulas are:
Min date
=min(numdate)
Count since 1.1.10
=Count({$<numdate = {">=$(vNumdate)"}>} numdate)
And thats the simple dashboard in qlikview:
(Hope I got it right.)

Two (seemingly) identical queries, one is faster, why?

Two seemingly identical queries (as far as a newbie like me can tell, but the first is faster overall in the partial template rendering time (nothing else changed but the ids statement). Also, when testing through rails console, the latter will visibly run a query, the former will not. I do not understand why - and why the first statement is a few ms faster than the second - though I can guess it is due to the shorter method chaining to get the same result.
UPDATE: My bad. They are not running the same query, but it still is interesting how a select on all columns is faster than a select on one column. Maybe it is a negligible difference compared to the method chaining though.
ids = current_user.activities.map(&:person_id).reverse
SELECT "activities".* FROM "activities" WHERE "activities"."user_id" = 1
SELECT "people".* FROM "people" WHERE "people"."id" IN (1, 4, 12, 15, 3, 14, 17, 10, 5, 6) Rendered activities/_activities.html.haml (7.4ms)
ids = current_user.activities.order('id DESC').select{person_id}.map(&:person_id)
SELECT "activities"."person_id" FROM "activities" WHERE "activities"."user_id" = 1 ORDER BY id DESC
SELECT "people".* FROM "people" WHERE "people"."id" IN (1, 4, 12, 15, 3, 14, 17, 10, 5, 6) Rendered activities/_activities.html.haml (10.3ms)
The purpose of the statement is to retrieve the foreign key reference to people in the order in which they appeared in the activities table, (on its PK).
Note: I use Squeel for SQL.
In the first query, you've chained .map and .reverse, while in the second query, you've used .order('id DESC') .select(person_id) which were unnecessary, if you added .reverse

Resources